export function throttle(fn, interval = 500) {
  let start = 0;
  let lastArgs;

  return function (...args) {
    const now = Date.now();

    lastArgs = args;

    if (now > start + interval) {
      start = now;
      return fn.apply(this, lastArgs);
    }
  };
}
